package yf.mall.vo.down;


import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.*;
import java.io.Serializable;



import yf.mall.entity.QuestionEntity;
import yf.mall.vo.QuestionVo;

                                import yf.mall.enums.QuestionStatusEnum;

/**
 * 问题表实体
 * 表名 question
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Dec 15 13:15:22 CST 2020
 */
@Data
public class QuestionDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

                        //
            @ExcelProperty("")
            private Long id;
        
                        //问答人id
            @ExcelProperty("问答人id")
            private Long userId;
        
                        //商品id
            @ExcelProperty("商品id")
            private Long goodsId;
        
                        //问答人昵称
            @ExcelProperty("问答人昵称")
            private String userName;
        
                        //问题图
            @ExcelProperty("问题图")
            private String img;
        
                        //问题内容
            @ExcelProperty("问题内容")
            private String content;
        
                        //问题时间
            @ExcelProperty("问题时间")
            private Date time;
        
                        //ENUM-状态:"NO-未通过","AUDIT-待审核","YES-已通过"
            @ExcelIgnore
            private Integer status;
                        @ExcelProperty("状态")
            private String statusStr;
        
    
    public QuestionDown() {

    }

    public QuestionDown(QuestionVo vo) {
        QuestionEntity entity = vo.getEntity();
                                    this.setId(entity.getId());
            
                                    this.setUserId(entity.getUserId());
            
                                    this.setGoodsId(entity.getGoodsId());
            
                                    this.setUserName(entity.getUserName());
            
                                    this.setImg(entity.getImg());
            
                                    this.setContent(entity.getContent());
            
                                    this.setTime(entity.getTime());
            
                                    this.setStatus(entity.getStatus());
                if(entity.getStatus()!=null){
                    this.setStatusStr( QuestionStatusEnum.indexOf(entity.getStatus()));
                }
            
            }


}
